﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SRAGWMCLib.OO
{

    /// <summary>
    /// Contains the values of the DataBase info
    /// </summary>
    /// 
    
    public class DataBase
    {           

        /// <summary>
        /// Type of DataBase to be used (Acess, Oracle, and others, 
        /// for a full list check Geomedia Documentation).
        /// </summary>

        public string DBType { get; set;}

        /// <summary>
        /// Path of the DataBase file
        /// </summary>

        public string DBPath { get; set; }

        /// <summary>
        /// Arguments to allow the connection to the DataBase 
        /// (username, password and others depending of the desired database, 
        /// for more info check Geomedia Documentation).
        /// </summary>

        public string ConnectionArguments { get; set;}

        /// <summary>
        /// Desired Name of the Connection, also used into the addMarker
        /// </summary>

        public string ConnectionName { get; set;}

        /// <summary>
        /// Path of the coordinate system file
        /// </summary>

        public string CoordSystemPath { get; set; }
        
        /// <summary>
        /// Fills the DataBase Class data
        /// </summary>
        /// <param name="pDBType">Type of DataBase to be used</param>
        /// <param name="pDBPath">Path for the DataBase file</param>
        /// <param name="pConnectionArguments">Arguments for the connection to the desired database, 
        /// if no arguments needed then it is set as ""</param>
        /// <param name="pConnectionName">Desired Name of the connection, 
        /// also used into the addMarker</param>
        /// <param name="pCoordSystemPath">Path for the coordinate system file</param>

        public DataBase(string pDBType, string pDBPath, string pConnectionArguments, 
                        string pConnectionName, string pCoordSystemPath)
        {
            DBType = pDBType;
            DBPath = pDBPath;
            ConnectionArguments = pConnectionArguments;
            ConnectionName = pConnectionName;
            CoordSystemPath = pCoordSystemPath;
        }

        public static DataBase DataBaseBuilder(string DBType, string DBPath, string ConnectionArguments, 
            string ConnectionName, string CoordSystemPath)
        {
            DataBase db = new DataBase(DBType, DBPath, ConnectionArguments,ConnectionName,CoordSystemPath);

            return db;
        }
    }
}
